#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=5e5+5,mod=998244353;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=(x<<1)+(x<<3)+ch-48,ch=getchar();}
	return x*f;
}
int n,k,a[N],col[N],dep[N],ans,tot;

int ksm(int x,int y){
	int res=1;
	while(y){
		if(y&1) res=res*x%mod;
		x=x*x%mod;
		y>>=1;
	}
	return res;
}

void dfs(int u){
	if(!col[a[u]]){
		col[a[u]]=col[u];
		dep[a[u]]=dep[u]+1;
		dfs(a[u]);
	}
	else if(col[a[u]]==col[u]) ans=(ans+ksm(dep[u]-dep[a[u]]+1,k))%mod;
}

void bfs(int pos){
	if(pos==n+1){
		tot=0;
		for(int i=1;i<=n;i++){
			if(!col[i]){
				col[i]=++tot;
				dep[i]=1;
				dfs(i);
			}			
		}
		for(int i=1;i<=n;i++) col[i]=dep[i]=0;
		return;
	}
	for(int i=1;i<=n;i++)
		a[pos]=i,bfs(pos+1);
}

signed main(){
	freopen("length.in","r",stdin);
	freopen("length.out","w",stdout);
	n=read(),k=read();
	bfs(1);
	printf("%lld",ans);
	return 0;
}
